﻿<Button
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	x:Class="HeritageAcademy.Library.Controls.UserTile"
	Height="73" Width="210"
	Margin="0,5,0,20" Cursor="Hand" FocusVisualStyle="{x:Null}"
	mc:Ignorable="d"
	>
	<Button.Resources>
		<Storyboard x:Key="slideOut">
			<DoubleAnimation To="-10" Duration="0:0:0.2" AccelerationRatio=".8" Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" />
		</Storyboard>
		<Storyboard x:Key="slideIn">
			<DoubleAnimation To="0" Duration="0:0:0.4" AccelerationRatio=".8" Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" />
		</Storyboard>

		<Storyboard x:Key="slideUp">
			<DoubleAnimation To="0" Duration="0:0:0.4" AccelerationRatio=".8" Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.Y)" />
		</Storyboard>

		<Storyboard x:Key="slideDown">
			<DoubleAnimation To="0" Duration="0:0:0.4" AccelerationRatio=".8" Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.Y)" />
		</Storyboard>

        <Style x:Key="stDetails" TargetType="Label">
            <Setter Property="FontFamily" Value="Segoe UI"/>
            <Setter Property="FontSize" Value="15"/>
            <Setter Property="Foreground" Value="#FF000000"/>
            <Setter Property="Padding" Value="0,0,0,0"/>
            <Setter Property="Margin" Value="0,0,0,0"/>
        </Style>

        <Style x:Key="stDetailsItemHeader" TargetType="Label" BasedOn="{StaticResource stDetails}">
            <Setter Property="FontSize" Value="12"/>
        </Style>

        <DrawingImage x:Key="iconArrowRight">
            <DrawingImage.Drawing>
                <DrawingGroup>
                    <DrawingGroup.Children>
                        <GeometryDrawing Brush="#FFFFFFFF" Geometry="F1 M 837.464,1005.66L 837.464,798.246L 941.173,901.955L 837.464,1005.66 Z ">
                            <GeometryDrawing.Pen>
                                <Pen Thickness="4" LineJoin="Round" Brush="#FF000000"/>
                            </GeometryDrawing.Pen>
                        </GeometryDrawing>

                        <GeometryDrawing Brush="#00000000" Geometry="F1 M 783.763,796.4L 994.874,796.4L 994.874,1007.51L 783.763,1007.51L 783.763,796.4 Z "/>

                    </DrawingGroup.Children>
                </DrawingGroup>
            </DrawingImage.Drawing>
        </DrawingImage>
        
    </Button.Resources>
	
    <Button.RenderTransform>
		<TranslateTransform X="0" Y="0" />
	</Button.RenderTransform>
	
    <Button.Template>
		<ControlTemplate TargetType="{x:Type Button}">
			<ContentPresenter />
		</ControlTemplate>
	</Button.Template>
	
    <Grid x:Name="grid">
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="118"/>
			<ColumnDefinition Width="0"/>
			<ColumnDefinition Width="92"/>
		</Grid.ColumnDefinitions>

		<Border x:Name="passwordBorder" Margin="0,0,0,-30" VerticalAlignment="Bottom" Visibility="Hidden" Height="31" 
		  Grid.ColumnSpan="3" BorderThickness="1" BorderBrush="#22000000" CornerRadius="3" Background="#FFFFFF">
			<PasswordBox x:Name="password" Margin="7,6,7,0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" BorderBrush="{x:Null}"
				FocusVisualStyle="{x:Null}" BorderThickness="0" Height="25"  />
		</Border>

		<Image x:Name="imgUser" Width="113" Height="68" VerticalAlignment="Top" HorizontalAlignment="Left" Stretch="UniformToFill" Clip="M0,12 C0,5.372583 5.372583,0 12,0 L101,0 C107.62742,0 113,5.372583 113,12 L113,56 C113,62.627417 107.62742,68 101,68 L12,68 C5.372583,68 0,62.627417 0,56 z" />

		<Grid x:Name="UserInfo" Grid.Column="2" Margin="0,0,0,0">
			<Grid.RowDefinitions>
				<RowDefinition Height="19"/>
				<RowDefinition Height="18"/>
				<RowDefinition Height="*"/>
				<RowDefinition Height="17"/>
				<RowDefinition Height="7"/>
			</Grid.RowDefinitions>
			<Label Grid.Row="0" x:Name="lbUserName" Foreground="#BB000000" Margin="5,0,0,0" FontSize="13" Padding="0,0,0,0" HorizontalAlignment="Left" SnapsToDevicePixels="True" TextOptions.TextFormattingMode="Display"/>
			<Label Grid.Row="1" x:Name="lbPosition" Content="" Foreground="#99A1A1A1" Margin="5,0,0,0" FontSize="12" Padding="0,0,0,0" HorizontalAlignment="Left" TextOptions.TextFormattingMode="Display" SnapsToDevicePixels="True"/>

			<Grid x:Name="logoutButton" Grid.Row="3" Cursor="Hand" Visibility="Hidden" Background="Transparent">
				<Grid.Triggers>
					<EventTrigger RoutedEvent="Mouse.MouseEnter">
						<BeginStoryboard>
							<Storyboard>
								<DoubleAnimation From="0.3" To="1" Duration="0:0:0.1" Storyboard.TargetName="imgArrow" Storyboard.TargetProperty="Opacity"/>
							</Storyboard>
						</BeginStoryboard>
					</EventTrigger>
					<EventTrigger RoutedEvent="Mouse.MouseLeave">
						<BeginStoryboard>
							<Storyboard>
								<DoubleAnimation To="0.3" From="1" Duration="0:0:0.1" Storyboard.TargetName="imgArrow" Storyboard.TargetProperty="Opacity"/>
							</Storyboard>
						</BeginStoryboard>
					</EventTrigger>
				</Grid.Triggers>
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="*"/>
					<ColumnDefinition Width="12"/>
				</Grid.ColumnDefinitions>
				<Label x:Name="lblogouttext" Content="выйти" 
					   Foreground="#FFA4A4A4" Style="{DynamicResource stDetailsItemHeader}" 
					   HorizontalAlignment="Right" TextOptions.TextFormattingMode="Display" SnapsToDevicePixels="True"/>
				<Image x:Name="imgArrow"  Grid.Row="3" Grid.Column="1"  Source="{DynamicResource iconArrowRight}" Width="6" Height="6" 
					VerticalAlignment="Center" HorizontalAlignment="Center" Opacity="0.3" Margin="0,1,0,0" />
			</Grid>
		</Grid>
	</Grid>
</Button>